<%@ page import="com.example.demo.entity.Novel" %>
<%@ page import="com.example.demo.service.NovelService" %>
<%@ page import="com.example.demo.service.impl.NovelServiceImpl" %>
<%@ page import="org.springframework.util.CollectionUtils" %>
<%@ page import="java.util.List" %>
<%--
  Created by IntelliJ IDEA.
  User: wan
  Date: 2021/8/24
  Time: 15:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>wan.depository</title>
    <link href="image/logo-depository.png" rel="icon" type="image/x-icon">
    <link href="css/depository.css" rel="stylesheet" type="text/css">
    <h2 align="center"><b>本地书库</b></h2>
    <style>
        em {
            font-size: 25px;
        }

        img {
            width: 100px;
            height: 130px;
        }

        .na {
            position: relative;
            left: 200px;
        }

        .au {
            position: relative;
            left: 200px;
        }

        .su {
            position: relative;
            left: 200px;
        }

        a {
            position: absolute;
            right: 150px;
        }
    </style>
</head>
<body>
<a href="find.jsp">首页</a>
<table align="center">
    <%
        NovelService novelService = new NovelServiceImpl();
        List<Novel> novels = novelService.getNovels();
        if (!CollectionUtils.isEmpty(novels)) {
            for (Novel n : novels
            ) {
    %>
    <form action="HelloNovel" method="get">
        <tr>
            <td><img src=<%= n.getImagePath() %> alt="图片走丢了"></td>
            <td class="na"><em><%= n.getNovelName() %>
            </em></td>
<%--            <td class="au"><em><%= n.getAuthor() %>--%>
<%--            </em></td>--%>
            <td>
                <input type="hidden" name="depository" value=<%= n.getNovelName() %>>
            </td>
            <td class="su">
                <input type="submit" value="开始阅读">
            </td>
        </tr>
        <tr>
            <td><br><br></td>
        </tr>
    </form>
    <%
            }
        }
    %>
</table>

</body>
</html>
